<template>
  <div>
    <div class="title">热销推荐</div>
    <ul>
      <router-link tag="li" :to="'/detail/' + item.id" class="item border-bottom" v-for="item in recommendList" v-bind:key="item.id">
        <div class="img-wrapper">
          <img :src="item.imgUrl" alt="">
        </div>
        <div class="info">
          <p class="info-title">{{item.title}}</p>
          <p class="info-dec">{{item.des}}</p>
          <button class="info-button">查看详情</button>
        </div>
      </router-link>
    </ul>
  </div>
</template>

<script>
export default {
  name: 'Recommend',
  props: ['recommendList'],
  data () {
    return {
    }
  }
}
</script>

<style lang="stylus" scoped>
  @import "~_styles/mixins.styl"
  .title
    margin-top: .2rem
    line-height: .8rem
    background: #eee
    text-indent: .2rem
  .item
    overflow: hidden
    display: flex
    height: 1.9rem
    .img-wrapper
      width: 1.7rem
      height: 1.7rem
      padding: .1rem
      img
        width: 100%
        height: 100%
    .info
      flex: 1
      padding: .1rem
      min-width: 0
      .info-title
        line-height: .54rem
        font-size: .32rem
        ellipsis()
      .info-dec
        line-height: .4rem
        color: #999
        ellipsis()
      .info-button
        margin-top: .2rem
        background-color: #ff9300
        padding: 0 .1rem
        border-radius: .06rem
        color: #fff
</style>
